const backgoundColor = [
    'linear-gradient(0deg, rgba(220,241,234,0) 0%, #14A675 100%)',
    'linear-gradient(0deg, rgba(224,237,255,0) 0%, #4791FE 100%)',
    'linear-gradient(0deg, rgba(255,246,213,0) 0%, #FAC400 100%)',
    'linear-gradient(0deg, rgba(238,233,255,0) 0%, #9F7BFF 100%)',
    'linear-gradient(0deg, rgba(255,230,229,0) 0%, #F75E58 100%)',
    'linear-gradient(0deg, rgba(235,236,241,0) 0%, #727D93 100%)',
    'linear-gradient(0deg, rgba(217,241,245,0) 0%, #00A0B8 100%)',
    'linear-gradient(0deg, rgba(254,233,202,0) 0%, #FC980E 100%)',
    'linear-gradient(0deg, rgba(255,228,243,0) 0%, #F454AC 100%)',
    'linear-gradient(0deg, rgba(250,227,255,0) 0%, #DA53F5 100%)',
    'linear-gradient(0deg, #DCF1EA 0%, #14A675 100%)',
    'linear-gradient(0deg, #E0EDFF 0%, #4791FE 100%)',
    'linear-gradient(0deg, #FFF6D5 0%, #FAC400 100%)',
    'linear-gradient(0deg, #EEE9FF 0%, #9F7BFF 100%)',
    'linear-gradient(0deg, #FFE6E5 0%, #F75E58 100%)',
    'linear-gradient(0deg, #EBECF1 0%, #727D93 100%)',
    'linear-gradient(0deg, #D9F1F5 0%, #00A0B8 100%)',
    'linear-gradient(0deg, #FEE9CA 0%, #FC980E 100%)',
    'linear-gradient(0deg, #FFE4F3 0%, #F454AC 100%)',
    'linear-gradient(0deg, #FAE3FF 0%, #DA53F5 100%)'
]
const color = [
    '#14A675',
    '#4791FE',
    '#FAC400',
    '#9F7BFF',
    '#F75E58',
    '#727D93',
    '#00A0B8',
    '#FC980E',
    '#F454AC',
    '#DA53F5',
    '#FA5151',
    '#C87D2F',
    '#CC9C00',
    '#74A800',
    '#3EB575',
    '#07C160',
    '#10AEFF',
    '#1196FF',
    '#8183FF',
    '#7D90A9',
    '#1485EE',
    '#6467F0',
    '#576B95'
]
function getRandomElements(arr, N) {
    const shuffled = [...arr].sort(() => Math.random() - 0.5)
    return shuffled.slice(0, N)
}
/**
 * 生成随机颜色值
 * @param {*} number
 * @returns
 */
function initColor(number) {
    return getRandomElements(color, number)
}
function getRandomValue() {
    const randomIndex = Math.floor(Math.random() * backgoundColor.length) // 获取随机索引
    return backgoundColor[randomIndex] // 获取数组的随机值
}
export default function colorTools() {
    return {
        initColor,
        getRandomValue
    }
}
